package com.sample.mockito;

import java.util.LinkedList;
import java.util.List;

public class PersonGroup {
    List<Person> group = new LinkedList<>();

    public List<Person> getGroup() {
        return group;
    }

    public void setGroup(List<Person> group) {
        this.group = group;
    }

    public Person getPerson(String name){
        for (Person person : group){
            if(person.getName().equals(name)){
                return person;
            }
        }
        return  null;
    }

    public void addPerson(Person person){
        group.add(person);
    }

    public int size(){
        return group.size();
    }
}
